import { IModuleRegistry, ISlotRegister, IReducerRegister, IRegisterProps } from '../../../core';
import reducer from './reducer';
import { ISidePanelProps, SidePanel } from './SidePanel';
import { Props } from './components/props';
import { Styles } from './components/styles';

export default class SidePanelModule implements IModuleRegistry {

    registerComponent(register: ISlotRegister) {
        register.register({
            component: SidePanel as IRegisterProps['component'],
            props: {
                items: [
                    {
                        label: '属性',
                        key: 'props',
                    },
                    // {
                    //     label: '样式',
                    //     key: 'styles',
                    // },
                ] as ISidePanelProps['items']
            },    
            slot: 'layout-sideRight',    
            componentSlot: ['sidePanel']
        })

        register.register({
            component: Props,
            props: {
                tab: 'props',
            },  
            slot: 'sidePanel', 
        })

        // componentRegister.register({
        //     component: Styles,
        //     props: {
        //         tab: 'styles',
        //     },  
        //     slot: 'sidePanel', 
        // })
    }

    registerReducer(reducerRegister: IReducerRegister) {
        reducerRegister.register('sidePanel', reducer);
    }
}